package com.yztstudy.clients;

import com.yztstudy.clients.impl.OrderHystrixImpl;
import com.yztstudy.param.PageParam;
import com.yztstudy.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 订单的远程调用接口
 */

@FeignClient(value = "order-service", fallback = OrderHystrixImpl.class)
public interface OrderFeignClient {

    /**
     * TODO 检查订单里面是否有要删除的商品
     * @param productId 要删除的商品Id
     * @return
     */
    @PostMapping("/order/check")
    public R check(@RequestBody Integer productId);


    /**
     * TODO 分页查询订单
     * @param pageParam 分页参数
     * @return
     */
    @GetMapping("/order/admin/list")
    public R adminList(@RequestBody PageParam pageParam);
}
